﻿namespace Vdc.Grid
{
    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Web.UI;

    [ParseChildren(true), PersistChildren(false), ToolboxItem(false)]
    public class TemplateContainer : Control, INamingContainer
    {
        private Vdc.Grid.Column _Column;
        private int _ColumnIndex;
        private Hashtable _DataItem;
        private object _DataObject;
        private int _DataRecordIndex;
        private string _GridClientID;
        private GridGroupInformation _group;
        private int _PageDataRecordIndex;
        private int _PageRecordIndex;
        private int _RecordIndex;
        private string _value;

        [Category("Grid settings"), Bindable(true), Description("The current column"), DefaultValue("")]
        public Vdc.Grid.Column Column
        {
            get
            {
                return this._Column;
            }
            set
            {
                this._Column = value;
            }
        }

        [Category("Grid settings"), Bindable(true), DefaultValue(""), Description("The index of the current column")]
        public int ColumnIndex
        {
            get
            {
                return this._ColumnIndex;
            }
            set
            {
                this._ColumnIndex = value;
            }
        }

        [Category("Template Container"), DefaultValue(""), Description("The DataItem collection of the container"), Bindable(true)]
        public Hashtable DataItem
        {
            get
            {
                return this._DataItem;
            }
            set
            {
                this._DataItem = value;
            }
        }

        [Description("The Object containing the data from the record."), DefaultValue(""), Bindable(true), Category("Template Container")]
        public object DataObject
        {
            get
            {
                return this._DataObject;
            }
            set
            {
                this._DataObject = value;
            }
        }

        [Description("The index of the current record (relative to the entire grid)"), Bindable(true), Category("Template Container"), DefaultValue("")]
        public int DataRecordIndex
        {
            get
            {
                return this._DataRecordIndex;
            }
            set
            {
                this._DataRecordIndex = value;
            }
        }

        [Category("Grid settings"), Description("The client-side ID of the Grid containing the template"), Bindable(true), DefaultValue("")]
        public string GridClientID
        {
            get
            {
                return this._GridClientID;
            }
            set
            {
                this._GridClientID = value;
            }
        }

        [Bindable(true), Description("Provides information about the current group"), Category("Grid settings"), DefaultValue("")]
        public GridGroupInformation Group
        {
            get
            {
                return this._group;
            }
            set
            {
                this._group = value;
            }
        }

        [Bindable(true), Category("Grid settings"), DefaultValue(""), Description("The index of the current record (relative to the current page)")]
        public int PageDataRecordIndex
        {
            get
            {
                return this._PageDataRecordIndex;
            }
            set
            {
                this._PageDataRecordIndex = value;
            }
        }

        [Bindable(true), Description("The index of the current record (relative to the current page)"), Category("Grid settings"), DefaultValue("")]
        public int PageRecordIndex
        {
            get
            {
                return this._PageRecordIndex;
            }
            set
            {
                this._PageRecordIndex = value;
            }
        }

        [Category("Template Container"), Bindable(true), Description("The index of the current record (relative to the entire grid)"), DefaultValue("")]
        public int RecordIndex
        {
            get
            {
                return this._RecordIndex;
            }
            set
            {
                this._RecordIndex = value;
            }
        }

        [Category("Template Container"), Bindable(true), Description("The Value of the container"), DefaultValue("")]
        public string Value
        {
            get
            {
                return this._value;
            }
            set
            {
                this._value = value;
            }
        }
    }
}

